/* eslint-disable no-var, prefer-template */
(function () {
  var $preview = $("[data-choose-template-preview]");
  var $templateName = $("[data-template-name]");
  var $templateDescription = $("[data-template-description]");

  $templateName.html("<%= translated_attribute @template.name %>");
  $templateDescription.html("<%= translated_attribute @template.description %>");

  $preview.html("<%= j(render partial: "preview", locals: { skip_authenticity_token: true, questionnaire: @questionnaire }) %>");

  var $container = $(".questionnaire-template-preview");
  $container.removeClass("hide");
}());
